package cc.mycraft.ds;

import java.util.Random;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import io.lumine.xikage.mythicmobs.MythicMobs;





public class main extends JavaPlugin{
	
	public static Random r = new Random();
	public static main main;
	public static main getInstance() {
		return main;
	}
	
	
	@Override
	public void onEnable() {
		main = this;
		saveDefaultConfig();
		
		Bukkit.getLogger().info("\n##################################################\n     DungeonSpawner Made by Gloried");
		Spawner.run();
		
		getServer().getPluginManager().registerEvents(new EntityLimit(), this);
		Bukkit.getLogger().info("Loading Complete!\n##################################################");
		
		super.onEnable();
	}


	@Override
	public void onDisable() {
		super.onDisable();
	}
	
	public boolean onCommand(CommandSender s, Command cmd, String label, String[] args) {
		String CmdName = cmd.getName().toLowerCase();
		switch (CmdName) {
		case "dsreload": Spawner.run();break;			
		case "testspawn": MythicMobs.inst().getMobManager().spawnMob(DungeonMob.randomMob(), ((Player)s).getLocation());break;			
		default: 
			s.sendMessage("可用指令列表：");
			s.sendMessage("/dsreload  -  重载刷怪参数");
			break;
		}
		return true;
	}
	
}
